UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pdFqlJhyF7ikLB05+Bnu442lrk5iMG2mRPj97wlyDT4=' 
WHERE 
  key_id = 'a011edfb82efe6b50346a97651e53bafe18b0473dd191aeea395608ef5c4398f' 
  AND (
    token = 'pdFqlJhyF7ikLB05+Bnu442lrk5iMG2mRPj97wlyDT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039