UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Phc+YZRQ80jJAPJnhMjmocmHL68yDYa3PBzN7OQlX0='
WHERE
key_id = '2fac2f6e8846c32606897f0755315c3d8252393989c5db5521a4c73338b799d0'
AND (
token = '0Phc+YZRQ80jJAPJnhMjmocmHL68yDYa3PBzN7OQlX0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)