UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jvPuTq9WK53VabWkGNJrDrFjqjvw4Sdc1j0zhSkONB0=' 
WHERE 
  key_id = '8842806ace625556d7a84bbcb10da5c8cc2cf5940e114c279cdfa2266caf2191' 
  AND (
    token = 'jvPuTq9WK53VabWkGNJrDrFjqjvw4Sdc1j0zhSkONB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028