UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ooy/9jSEzjwXU+UN/2uWdRLRKLzggBeIN/XsAym+na4='
WHERE
key_id = 'c941b070f29c5faa17d90c176dfe125a569a7de41188c721ead7f68fa37b30dc'
AND (
token = 'ooy/9jSEzjwXU+UN/2uWdRLRKLzggBeIN/XsAym+na4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)