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