UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hEs5fHk6FDj+Jt7WQfq+dmuh/NRMolVKqYr3F0EffMg='
WHERE
key_id = 'a71ee0403c28f1d1248d35caed7ab79c2a0450f3113ff1ce13c6b66f3c1c11bd'
AND (
token = 'hEs5fHk6FDj+Jt7WQfq+dmuh/NRMolVKqYr3F0EffMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)