UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bMZYvNU9HMHxNiRvNCFRxecR1OgvwayrLzv4Xqbuyas='
WHERE
key_id = '414373fea18c64061b3c178e6458240fedb334de66db14c2bcddc5ed8e717d6c'
AND (
token = 'bMZYvNU9HMHxNiRvNCFRxecR1OgvwayrLzv4Xqbuyas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)