UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OqPIKfzuqF1az6eQp2ZeJnZxVl3bzF/eyB+uo84D+wM='
WHERE
key_id = '6417e079e40ad975f4aeff7d4fc9095e320aea2dea75510c29148268b52fd3cd'
AND (
token = 'OqPIKfzuqF1az6eQp2ZeJnZxVl3bzF/eyB+uo84D+wM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)