UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jiKVE6bO/g21BCVVd5nMFM2lz3GSEKM8wTxQGirMNH8='
WHERE
key_id = '07329b6790d283d82f8700053778ed5e228f885b8dbce4746572496044ecad6e'
AND (
token = 'jiKVE6bO/g21BCVVd5nMFM2lz3GSEKM8wTxQGirMNH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)