UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R03GR/AxeoGnOqL/coQC8vwadg7PzhjUeKqg+1HIk2I=' 
WHERE 
  key_id = 'afb1becd4dcf403d00c7b3e11508d8537d52cbdc6d66f9bc0e9889b6b971f390' 
  AND (
    token = 'R03GR/AxeoGnOqL/coQC8vwadg7PzhjUeKqg+1HIk2I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045