UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tKY+uH3j/t2ObnO2uu82kiT1QJRVJLACt1EcevVsQLI=' 
WHERE 
  key_id = '485bbf12dab99da7552e70ba2f84610004226ae39b741d70a2ac2223ea3a3272' 
  AND (
    token = 'tKY+uH3j/t2ObnO2uu82kiT1QJRVJLACt1EcevVsQLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021