UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5wjkGC0j3EHi9cl2BqXpNW+RCh7eegKWvRnfIp8niu8='
WHERE
key_id = 'df53cf1d25b49214d0281aaaebd63f5956f38d1cc166d1344dc05e57ec7f5036'
AND (
token = '5wjkGC0j3EHi9cl2BqXpNW+RCh7eegKWvRnfIp8niu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)