UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E+bd7c4q8yfDqjukRJ8Y3TU5uzDuxaJ4ieO5XuLguU4='
WHERE
key_id = '8cab3f1d6b80ecc019cdde1fccb2b4b45a7ad63d3ac0e957388a937a128e445d'
AND (
token = 'E+bd7c4q8yfDqjukRJ8Y3TU5uzDuxaJ4ieO5XuLguU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)