UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y05XTCevIwtVigjBeSFzC9F+U/F+5njhX42ZZUPIq7g='
WHERE
key_id = '0995bc0364cda14f3331813e1c0362eff2e6a8c7840f5082bf5a5917dc18c6a1'
AND (
token = 'Y05XTCevIwtVigjBeSFzC9F+U/F+5njhX42ZZUPIq7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)