UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2VxDAUqCAWIgQkZkJLO22nA0DR3aZiZPtJgkUrBPJ8E='
WHERE
key_id = '4ef1035861818fe9c60a960ab81a7fd6a77ddb27b5acd352c6d4bccbfa6e559c'
AND (
token = '2VxDAUqCAWIgQkZkJLO22nA0DR3aZiZPtJgkUrBPJ8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)