UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41Qn7H4MTcBaZ5hFim0dHlWVwIqd19K8bwtmPROMbFw='
WHERE
key_id = 'abda7db92e73de581cb62e46c525dad5ec8bdace4e2c7b1034b6e112a901eb02'
AND (
token = '41Qn7H4MTcBaZ5hFim0dHlWVwIqd19K8bwtmPROMbFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)