UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6BqjPSrdmZ3iRN3+akl3yTOvxgzxl9aOc8V1QHZ+Xd0='
WHERE
key_id = '5c59605ced205d52a1aa0a33ecb8c0526de71a8363d168b1ee8dbd2c5dd0c908'
AND (
token = '6BqjPSrdmZ3iRN3+akl3yTOvxgzxl9aOc8V1QHZ+Xd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)