UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DRuwIRKrwDm7JOA355lX6ggadzXyZFTTeYhp4m0MAqU='
WHERE
key_id = 'dc278e4dcb6edd24935ada072ff3c3ae5ac8b6fcdde25e52b7b8b28177b9333c'
AND (
token = 'DRuwIRKrwDm7JOA355lX6ggadzXyZFTTeYhp4m0MAqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)