UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIkiFnxDpwx0IQ5eHxFi4qDyPlR0Dk/waFX+vZ66BNQ=' 
WHERE 
  key_id = '2581ed645fab54c64c64a0a1bc9997021ece1208227fe21df83020bc35c04428' 
  AND (
    token = 'EIkiFnxDpwx0IQ5eHxFi4qDyPlR0Dk/waFX+vZ66BNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038