UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B1Ij6piypKyWWwDNqRYsHT9kRrZCjKoM1pWvAMWkKKo='
WHERE
key_id = '768490d52b4dd44ada2af70a94ca08333f3f1fcdbdd79421ce69ae78ab0e7866'
AND (
token = 'B1Ij6piypKyWWwDNqRYsHT9kRrZCjKoM1pWvAMWkKKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)