UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ydlRKylpEqjcaFmjhLeUw7habIZprUjCBo83lpXVApo='
WHERE
key_id = '7972b526adcf42800b3291899ce455752271fc4a0557ab5776c374658c9ddcb1'
AND (
token = 'ydlRKylpEqjcaFmjhLeUw7habIZprUjCBo83lpXVApo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)