UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2oYaYdU7dvmf5Qtl7fq0F+nqXzHlbAvkG+F+AOFktwo='
WHERE
key_id = '82b98b56e893df407e50a0f450e912d701b0fe466d1edb9ccaf63b79de8bdc71'
AND (
token = '2oYaYdU7dvmf5Qtl7fq0F+nqXzHlbAvkG+F+AOFktwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)