UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't1Gh3caXnLKBxEPDyxdyhhfqFmh/LkcPzC58UOdzlWE='
WHERE
key_id = 'bb0c88c097871d3acbbe2a513689752a6d1b30a8c37f118107caf19a0c2a68f1'
AND (
token = 't1Gh3caXnLKBxEPDyxdyhhfqFmh/LkcPzC58UOdzlWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)