UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ulmp39t+1LIgUO7HZG68UZ07wVYglxaWmSMr26eQRnQ='
WHERE
key_id = 'efce63ac4a6b56dbfa03da906ce55339034b3a3ecd1d766f693e28fcc6f37650'
AND (
token = 'Ulmp39t+1LIgUO7HZG68UZ07wVYglxaWmSMr26eQRnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)