UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MdSA6mW/KuJbZ/LR44tr1Aub8N9ravzeur1dp0qEZ0I='
WHERE
key_id = 'b92c2be890ef7b133a2140478d8130bd3355137be93595001180877f33d20b90'
AND (
token = 'MdSA6mW/KuJbZ/LR44tr1Aub8N9ravzeur1dp0qEZ0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)