UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+OpLWE30a207BqodyGOUW68X+Z6dpmrd0vu4tLlniD4=' 
WHERE 
  key_id = '6a3c363a77f6b48187703cbae079c7dfd900ffaedbb84fc4c977d4b6f4d4aa69' 
  AND (
    token = '+OpLWE30a207BqodyGOUW68X+Z6dpmrd0vu4tLlniD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024