UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '111ooPgtzibYh3uZtVpsnbe20tQeFzQsqxHfDasuhtg=' 
WHERE 
  key_id = '8a5c9dc37b91f115a921acb5a0e5fa0377a5e3066eb139f25a5c1112920b23ed' 
  AND (
    token = '111ooPgtzibYh3uZtVpsnbe20tQeFzQsqxHfDasuhtg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027