UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4C9wGneOT3ecs5dks4ISxK5L/lZYEVdK11osx4T/6uo='
WHERE
key_id = '37ec58e7847d1df790cb1037dcd42c705d88623a2345d14640b3c60c885673cd'
AND (
token = '4C9wGneOT3ecs5dks4ISxK5L/lZYEVdK11osx4T/6uo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)