UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kiiRfxIS8sKew2hjvJWAfTaVeDCewH+w5up3JqGgjk='
WHERE
key_id = '5dba3cbd8950575f28d2893cdbe4f8238ec6c0334420bc3c346b1b913fd7244b'
AND (
token = '0kiiRfxIS8sKew2hjvJWAfTaVeDCewH+w5up3JqGgjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)