UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '150CZUac4PmZKx3TDxpdpmnNx19cIZ+nUQ8LnZtggE0='
WHERE
key_id = 'e1271a2c9af84751e730c3d95d833c9661e668bdaf43b2ad0ed929e536ee4f97'
AND (
token = '150CZUac4PmZKx3TDxpdpmnNx19cIZ+nUQ8LnZtggE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)